package com.kuang.springcloud.service;


import com.kuang.springcloud.pojo.Dept;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

@Component
//value服务名字
@FeignClient(value = "springcloud-provider-dept", fallbackFactory = DeptClientServiceFallBackFactory.class)
public interface DeptClientService {

    @GetMapping("/dept/get/{no}")
    Dept QueryByNo(@PathVariable("no") long no);

    @GetMapping("/dept/list")
    List<Dept> QueryAll();

    @PostMapping("/dept/add")
    Boolean addDept(Dept dept);

}
